package com.platform.service.impl;

import com.platform.cache.J2CacheUtils;
import com.platform.util.Constants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.platform.dao.TextConfigDao;
import com.platform.entity.TextConfigEntity;
import com.platform.service.TextConfigService;

/**
 * Service实现类
 *
 * @author liweihai
 * @email liweihai12345@sina.com
 * @date 2019-03-18 14:17:08
 */
@Service("textConfigService")
public class TextConfigServiceImpl implements TextConfigService {
    @Autowired
    private TextConfigDao textConfigDao;

    @Override
    public TextConfigEntity queryObject(Integer id) {
        return textConfigDao.queryObject(id);
    }

    @Override
    public List<TextConfigEntity> queryList(Map<String, Object> map) {
        return textConfigDao.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return textConfigDao.queryTotal(map);
    }

    @Override
    public int save(TextConfigEntity textConfig) {
        J2CacheUtils.clear(Constants.REDIS_TEXT_CONF);
        return textConfigDao.save(textConfig);
    }

    @Override
    public int update(TextConfigEntity textConfig) {
        J2CacheUtils.clear(Constants.REDIS_TEXT_CONF);
        return textConfigDao.update(textConfig);
    }

    @Override
    public int delete(Integer id) {

        J2CacheUtils.clear(Constants.REDIS_TEXT_CONF);
        return textConfigDao.delete(id);
    }

    @Override
    public int deleteBatch(Integer[] ids) {
        J2CacheUtils.clear(Constants.REDIS_TEXT_CONF);
        return textConfigDao.deleteBatch(ids);
    }
}
